package com.ben.tcptester;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

@SpringBootApplication
public class TcptesterApplication {
	private static final Logger logger = LoggerFactory.getLogger(TcptesterApplication.class);

	public static void main(String[] args) throws Exception {
		//启动Spring
		ApplicationContext ctx = SpringApplication.run(TcptesterApplication.class, args);
		Environment environment = ctx.getEnvironment();
		String[] profiles = environment.getActiveProfiles();
		String prot = environment.getProperty("server.port");
		String path = environment.getProperty("server.context-path");
		String ip = environment.getProperty("server.address");
		System.out.println("Current Profile:" + profiles[0] + ". Server run at: http://"+ip + ":" + prot + path);
	}
}